﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zocono.WCS.Domain.EntityInfo;
using Zocono.WCS.Infrastructure.ApllicationDto.DtoUser;

namespace Zocono.WCS.Domain.UserManageDomain
{
    public interface IUser : IAggregationRoot
    {
        /// <summary>
        /// 用户修改密码
        /// </summary>
        /// <param name="newPassword"></param>
        /// <returns></returns>
        Task<bool> UpdatePasswordAsync(long ID, string newPassword, string oldPassword);
        /// <summary>
        /// 管理员重置用户密码
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="newPassword"></param>
        /// <returns></returns>
        Task<bool> ResetPasswordAsync(long ID, string newPassword);
        /// <summary>
        /// 测试AuoMapper数据
        /// </summary>
        /// <returns></returns>
        bool Add();

        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        Task<UserInfoDto> LoginAsync(string userName, string password);
             /// <summary>
        /// 用户刷卡登录
        /// </summary>
        Task<UserInfoDto> LoginByIcAsync(string code);
        /// <summary>
        /// 根据ID查用户信息
        /// </summary>
        /// <param name="Id"></param>
        Task<bool> GetByIdAsync(long Id);

        /// <summary>
        /// 管理员恢复他人密码
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        ///  优化参数  聚合根
        Task<bool> InitPasswordAsync(List<string> userNames);

        /// <summary>
        ///  （管理员）新增他人用户密码
        /// </summary>
        /// <param name="userInfo"></param>
        /// <returns></returns>
        /// 聚合根  返回主键ID 

        Task<long> AddUserInfoAsync(UserInfoDto userInfoDto);

        /// <summary>
        /// （管理员）修改用户信息 只能修改部门，工号，角色，姓名
        /// </summary>
        /// <param name="userInfo"></param>
        /// <returns></returns>   
        //聚合根  返回Bool 
        Task<bool> UpdateUserInfoAsync(UserInfoDto userInfoDto);

        /// <summary>
        /// （管理员）删除用户信息，只修改是否删除状态，更新操作日期
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        /// 聚合根  返回bool 
        Task<bool> DeleteUserInfoAsync(long ID);

        /// <summary>
        /// 查询用户信息
        /// </summary>
        /// <param name="userID"></param> 
        /// <returns></returns>
        /// 聚合根  
        Task<UserInfoDto> GetUserInfoAsync(long ID);

        /// <summary>
        /// 返回角色功能表
        /// </summary>
        /// <returns></returns>
        //优化返回值Dto ,聚合根
        Task<List<RoleFunctionInfoDto>> GetRoleFunctionInfoTreeAsync(long roleID);

        Task<List<RoleFunctionInfoAllShow>> GetRoleFunctionInfoAllTreeAsync(long roleID);

        Task<List<RoleFunctionInfoDto>> GetAllRoleFunctionInfoTreeAsync(long roleID);
    }
}
